<?php
function getcaptcha()
	{
		$md5_hash = md5(rand(0,999)); 
		$security_code = substr($md5_hash, 15, 5); 
		$_SESSION["security_code"] = $security_code;
		//$this->session->set_userdata(array('security_code'=>$security_code)) ;
		$width = 100; 
		$height = 28;  
		$image = imagecreate($width, $height);  
		$white = imagecolorallocate($image, 255, 255, 255); 
		$black = imagecolorallocate($image, 0, 0, 0); 
		imagefill($image, 0, 0, $black); 
		imagestring($image, 10, 28, 6, $security_code, $white); 
		header("Content-Type: image/jpeg"); 
		imagejpeg($image); 
		imagedestroy($image); 
	}